<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>前端监控</title> 
    </head>
    <body>
        <div class="content aaa" >
            <input id="1" type="button" value="js出错" onclick="errClick()">
            <input id="2" type="button" value="promise出错" onclick="promiseClick()">
        </div>
        <div class="http">
            <input id="http1" type="button" value="http 请求失败" onclick="errorSend()">
            <input id="http2" type="button" value="http 请求数据" onclick="getData()">
        </div>
        <div id="container">
            
            
        </div>
        
        <script>
            let content = document.querySelector('#container');
            // content.innerHTML =  '<p>1<p>'.repeat(99)
            // window.a.b = '1'
            function errClick() {
                window.a.b = 1;
            }
            function promiseClick() {
                    let p = new Promise((resolve,reject) => {
                        window.a.b = 1;
                        // reject('fail')
                    }).then(res => {
                        console.log(res);
                    });
            }
            function getData(){
                let xhr = new XMLHttpRequest();
                xhr.open('get','http://localhost:3000/user?currentPage=1&pageSize=5');
                xhr.send();
                xhr.onload = function (){
                    console.log(xhr.responseText);
                }
            }
            function errorSend(){
                let xhr = new XMLHttpRequest();
                xhr.open('get','http://localhost:3000/123');
                xhr.send();
                // xhr.abort();
                xhr.onload = function (){
                    console.log(xhr.responseText);
                }
            }
        </script>
        <!-- <script src="./someError.js"></script> -->
    </body>
</html>
